package com.bitrate.dagger.redis.context;

import java.util.concurrent.ConcurrentHashMap;

import org.springframework.data.redis.core.RedisTemplate;

public class RedisManager {

	private ConcurrentHashMap<String, RedisTemplate<String, Object>> redisTemplateMap;

	public RedisManager(ConcurrentHashMap<String, RedisTemplate<String, Object>> redisTemplateMap) {
		this.redisTemplateMap = redisTemplateMap;
	}

	public RedisTemplate<String, Object> redisTemplate(int dbIndex) {
		RedisTemplate<String, Object> redisTemplate = redisTemplateMap.get("redisTemplate" + dbIndex);
		return redisTemplate;
	}

	public ConcurrentHashMap<String, RedisTemplate<String, Object>> getRedisTemplateMap() {
		return redisTemplateMap;
	}

}
